WiFiSTA - method setDNS as in WiFi libraries by Arduino#8854
Conversation
|
Thanks for the PR, but we will probably go another way. On our platform, the DNS servers are set for all client interfaces and are not specific to a given one, meaning, if you have ETH and WiFi together, they will use the same DNS servers for both connections. The API as such is and will be misleading. |
|
the reason to do Arduino platform and libraries is not because it has good, clear and not confusing API |
|
yes, now go explain that to the users who complain that we allow setting DNS to interfaces, while it actually sets it globally. |
ccc298d to
d1fe22a
Compare
|
merging now, will add notes about compatibility as part of the rework |
so the DNS server returned with DHCP on some interface is added to global registry of DNS servers? even if it is in LAN like for example 192.168.0.1 which is not valid for network interfaces connected to a different LAN? |
|
I'm not sure I understood your question clearly, but to explain slightly better: DNS and interface addresses are not necessarily connected. DNS servers only resolve names to addresses and are expected to always return the same addresses, regardless of your local network address. Google.com will always resolve to google's servers for example. From then on, it's up to your network routing to figure out which interface to use and how to get to the resolver IP address from DNS and reach the target server. So having the same DNS is nothing bad or wrong, as long as your ESP has a way to reach the DNS IP and then the resolved IPs |
Arduino doc: https://www.arduino.cc/reference/en/libraries/wifi/wifi.setdns/
I write about the motivation for this in the other PR